import 'package:shared_preferences/shared_preferences.dart';
///    author : leo
///    e-mail : jkliao@yeah.net
///    date   : 2020-03-28
///    desc   :
 class LocalStorage {
  static get(String key) async {
    SharedPreferences sp = await  SharedPreferences.getInstance();
    return sp.get(key);
  }

  static setString(String key, String value) async {
    SharedPreferences sp = await SharedPreferences.getInstance();
    return await sp.setString(key, value);
  }

  static setInt(String key, int value) async {
    SharedPreferences sp = await SharedPreferences.getInstance();
    return await sp.setInt(key, value);
  }

  static setBool(String key, bool value) async {
    SharedPreferences sp = await SharedPreferences.getInstance();
    return await sp.setBool(key, value);
  }

  static setDouble(String key, double value) async {
    SharedPreferences sp = await SharedPreferences.getInstance();
    return await sp.setDouble(key, value);
  }

  static setStringList(String key, List<String> value) async {
    SharedPreferences sp = await SharedPreferences.getInstance();
    return await sp.setStringList(key, value);
  }
 }